package com.byq.mm.smartlib.obd;

import android.content.Context;

import com.byq.mm.smartlib.obd.commands.decoder.CommandDecoder;
import com.byq.mm.smartlib.component.SensorView;

public class ObdSensorDevice{
	CommandDecoder device;
	SensorView view;
	public ObdSensorDevice(Context ctx, CommandDecoder dev){
		device = dev;
		double step = (device.getMax() - device.getMin())/10;
		double sstep = step/5;
		view = new SensorView(ctx,(int)device.getMax(),(int)device.getValue(), (short)0, device.getName());
		
	//	device.addListener(this);
	}
	

	public void onLevel(double level) {
		view.update((int)device.getValue(), (int)device.getMax());
		
	}

	
	
}